The present invention relates to a communication method preferable for application in communication between apparatus connected through serial-bus based on, for example, IEEE1394 type, communication apparatus and communication system employing this communication method, and providing medium storing a program for carrying out this communication.
Audio visual apparatus capable of transmitting information through a network based on serial communication bus based on IEEE1394 type has been developed. By transmitting a predetermined command (AV/C command transaction set: hereinafter referred to as AV/C command) in this network, the AV apparatus connected to this network can be controlled. Details of the IEEE1394 type and AV/C command are described in AV/C Digital Interface Command Set General Specification publicized by 1394 Trade Association.
Communication using the IEEE1394 type bus includes a conditional operation called lock transaction. This lock transaction is used for set-up after a target apparatus connected through bus is locked and its content is investigated. That is, a transaction for communication between a request party and a response party through bus is specified and update of individual data is carried out at the response party according to this transaction.
For example, as shown in FIG. 1, a digital satellite broadcasting receiver (Integrated Receiver Decoder: IRD) 10 and, an audio deck 20 are connected through a bus 1 based on IEEE1394 type. Bi-directional connection is established between the audio deck 20, which is a target apparatus and the IRD 10 through isochronous channel by a lock transaction by a request from the IRD 10. Further, an apparatus having a function called IRM (Isochronous Resource Manager) is connected to the bus 1. This IRM may be either the IRD 10 or the deck 20.
The lock request (Lock Request) from a control apparatus (IRD 10 in FIG. 1) has two parameters [arg value] and [data value]. A current value of a register which it is intended to write-in is specified in the [arg value] and a value desired to write is specified in the [data value to try write].
A lock response (Lock Response) sent from a target apparatus corresponding to transmission of the request from the control apparatus has [old value] as a parameter. A current value of a register which it is intended to write-in is stored in this.
The control apparatus determines whether or not the response [old value] as parameter sent by the target apparatus is equal to the requested [arg value] as parameter. If they are equal, it is determined that write of the appropriate data has succeeded. If they are not equal, it is determined that the write has failed.
Such conditional write method is called comparison and exchange [compare and swap]. The reason why it is called [compare and swap] is that if the current value is compared with [arg value] and they are equal, it is exchanged with the [data value].
As described above, the conventional processing requires two actions, that is, a processing for reading out a value of a register to be written and a processing for converting that read out value to a value desired to be written. Thus, there is such a problem that it takes a number of operations and times to carry out the lock transaction.
An object of the present invention is to enable a lock transaction to be carried out between apparatus connected through such a bus as IEEE 1394 type with fewer data transmission processings.
According to a first invention, there is provided a communication method for communicating between apparatuses connected through a predetermined serial communication bus, wherein in case where a register conditionally writable is mounted in a predetermined apparatus connected through the serial communication bus, when it is intended to write in the apparatus having the register through the bus from other apparatus, a value estimated to be written in the register and a value to be written into the register are instructed so as to update a value written in the register. Consequently, when the value estimated to be written in the register coincides with the value actually written in the register, the register value can be updated to an instructed value immediately, so that the conditional write can be made to succeed with fewer data transmissions. Thus, network traffic can be reduced by that corresponding amount.
According to a second invention, there is provided a communication method as claimed in the first invention wherein the value estimated to be written in the register is a fixed value preliminarily set up. Consequently, by preparing a fixed value for each register type, a possibility that the value written in the register coincides with the estimated value is intensified, so that a possibility that conditional write is made to succeed with fewer data transmissions is intensified.
According to a third invention, there is provided a communication method as claimed in the first invention wherein the value estimated to be written in the register is a value of a register accessed last by the other apparatus. Consequently, unless access is made from other apparatus, the register value coincides so that write into the register is carried out. As a result, a possibility that conditional write is made to succeed with fewer data transmissions is intensified.
According to a fourth invention, there is provided a communication method as claimed in the third invention wherein when the serial communication bus is reset, the value of the register stored as a value of the register accessed last by the other apparatus is changed to a predetermined value and the value of the register is updated according to the changed value. Consequently, when the bus reset occurs, the conditional write can be carried out successfully.
According to a fifth invention, there is provided a communication method as claimed in the first invention wherein when the register depends on a value of other register, the value of the register is updated according to the value of the other register. Consequently, the possibility that the conditional write succeeds is further intensified.
According to a sixth invention, there is provided a communication method as claimed in the first invention wherein the value estimated to be written in the register is estimated by a predetermined processing. Consequently, the conditional write can be carried out successfully based on an estimation.
According to a seventh invention, there is provided a communication apparatus for communicating with a mating connected through a predetermined serial communication bus so as to control write into a conditionally writable register by communication through the serial communication bus, the communication apparatus comprising: a control means for setting the value estimated to be written into the register and the value to be written into the register; and a transmitting means for transmitting the value estimated to be written and the value to be written, these values being set up by the control means, to the mating. Consequently, the conditional write into a register of the mating connected through the bus can be carried out successfully with fewer data transmissions.
According to an eighth invention, there is provided a communication apparatus as claimed in the seventh invention wherein the value estimated to be written in the register set up by the control means is a fixed value set preliminarily. Consequently, by preparing the fixed value for each type of the register, the possibility that the value written in the register coincides with the estimated value is intensified, so that the possibility that the conditional write can be carried out successfully with fewer data transmissions is also intensified.
According to a ninth invention, there is provided a communication apparatus as claimed in the seventh invention further comprising a storage means for storing a value of a register accessed last by the transmitting means, wherein the value estimated to be written in the register set up by the control means is a value of a register accessed last, stored in the storage means. Consequently, unless access is made from other apparatus, the register value coincides so that the write into the register is carried out. As a result, the possibility that the conditional write can be carried out successfully with fewer data transmissions is intensified.
According to a tenth invention, there is provided a communication apparatus as claimed in the ninth invention wherein when the control means detects a bus reset, the value of the register stored in the storage means is changed to a predetermined value and the value of the register is updated according to the changed value. Consequently, when the bus reset occurs also, the conditional write can be carried out successfully immediately.
According to an eleventh invention, there is provided a communication apparatus according to the seventh invention wherein the register is a register depending on a value of other register and the control means updates the value of the register according to the value of the other register. Consequently, the possibility that the conditional write can be carried out successfully is further intensified.
According to a twelfth invention, there is provided a communication apparatus as claimed in the seventh invention wherein the value estimated to be written in the register set up by the control means is a value estimated by a predetermined processing. Consequently, the conditional write can be made successfully based on an estimation.
According to a thirteenth invention, there is provided a communication system for communicating between a first apparatus and a second apparatus connected through a predetermined serial communication bus, the second apparatus having a conditionally writable register by communication from the first apparatus through the serial communication bus, the first apparatus comprising: a control means for setting the value estimated to be written into the register and the value to be written into the register; and a transmitting means for transmitting the value estimated to be written and the value to be written, these values being set up by the control means, to the mating, the second apparatus having a control means for, when a value estimated to be written in the register instructed from the first apparatus coincides with a value written in the register, updating to a value instructed as a value to be written. Consequently, a communication system in which the conditional write in the register of the second apparatus connected through the bus with fewer data transmissions from the first apparatus can be secured.
According to a fourteenth invention, there is provided a providing medium for providing a program storing a communication procedure for communicating between apparatuses connected through a predetermined serial communication bus, wherein in case where a register conditionally writable is mounted in a predetermined apparatus connected through the serial communication bus, when it is intended to write in the apparatus having the register through the bus from other apparatus, a value estimated to be written in the register and a value to be written into the register are instructed so as to update a value written in the register. Consequently, by mounting a program stored in this medium, the conditional write in the register can be carried out successfully with fewer data transmissions.